#include <JXQCore/JStringList>
#include <JXQCore/JDebug>

using namespace JXQ;

int main(int argc, const char *argv[])
{
	J_UNUSED(argc);
	J_UNUSED(argv);

	setlocale(LC_ALL, "chs");

    jDebug() << JString::number(277) << JString::number(32767,16) << JString::number(3.1415926,7);

    jDebug() << JString("277").toInt() << JString("0x7FFF").toInt(16) << JString("3.1415926").toDouble(4);

    jDebug() << "\n-----------------------------------------------------\n";

	JString str1 = jtr("hello world");

	jDebug() << str1;

	JString str2 = jtr("你好世界");

	jDebug() << str2;

	JStringList slist1 = str1.split();

	jDebug() << slist1;

	slist1 << "123" << "abc";

	jDebug() << slist1.join(" - ");

	JString str3 = "number: %1 %2 %3 xyz";

	jDebug() << str3.arg(1).arg(2).arg(3).arg(4);

	jDebug() << str3.arg("aa", "bb", "cc");

	jDebug() << str3.arg("我", "爱", "你");

	jDebug() << "\n-----------------------------------------------------\n";

	JStringW wstr1 = L"hello world";

	jDebug() << wstr1;

	JStringW wstr2 = L"a 你好世界 b";

	jDebug() << wstr2;

	JStringWList wslist1 = wstr1.split();

	jDebug() << wslist1;

	wslist1 << L"123" << L"abc";

	jDebug() << wslist1.join(L" - ");

	JStringW wstr3 = L"number: %1 %2 %3 xyz";

	jDebug() << wstr3.arg(1).arg(2).arg(3).arg(4);

	jDebug() << wstr3.arg(L"aa", L"bb", L"cc");

	jDebug() << wstr3.arg(L"我", L"爱", L"你");

	return 0;
}

// MSVC is annoying
